//
//  PxBaseView.m
//  PxHelper
//
//  Created by lpc on 2019/10/18.
//  Copyright © 2019 lpc. All rights reserved.
//

#import "PxBaseView.h"

@implementation PxBaseView

+(id)viewWithSelfNib
{
    return [[self class] viewWithNibName:NSStringFromClass([self class])];
}

+ (id)viewWithNibName:(NSString *)nibName
{
    UINib *nib = [UINib nibWithNibName:nibName bundle:nil];

    NSArray *nibObjects = [nib instantiateWithOwner:nil options:nil];
    UIView *view = nil;
    if (nibObjects && nibObjects.count >0 )
    {
        view = [nibObjects objectAtIndex:0];
    }

    if ([view isKindOfClass:[PxBaseView class]])
    {
        [(PxBaseView *)view customInit];
    }

    return view;
}

- (void)customInit
{

}

@end
